<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>斑马线边框</title>
  <style>
    .box {
      width: 300px;
      margin: 10px auto;
      text-align: center;
      padding: 5px;
      border-radius: 5px;
      background: repeating-linear-gradient(-45deg,
          #e8544d 0px 10px,
          #fff 10px 20px,
          #75adf8 20px 30px,
          #fff 30px 40px) -20px -20px;
      background-size: 150%;
      transition: background 200ms;
    }

    .box:hover {
      background-position: 0 0;
      box-shadow: 0 0 10px 0 #ccc;
    }

    .cart {
      padding: 0;
      margin: 0;
      background-color: white;
      padding: 10px;
    }
  </style>
</head>

<body>
  <div class="box">
    <p class="cart">
      Lorem ipsum, dolor sit amet consectetur adipisicing elit. Facere perferendis natus architecto,
      voluptates, numquam ipsum possimus sint tenetur sed cumque quidem exercitationem fugiat repellendus dolorum
      placeat obcaecati. Pariatur, quibusdam harum?
    </p>
  </div>
</body>

</html>